package org.opens.protobuf.test;

import cn.hutool.core.util.IdUtil;
import com.google.protobuf.ByteString;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.opens.protobuf.MessageProto;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * 功能描述
 *
 * @author: zhangyuming
 */
public class MessageProtoWavMessageHandle extends SimpleChannelInboundHandler<MessageProto.WavMessage> {

    private ByteStringNodeHelper byteStringNodeHelper = new ByteStringNodeHelper("C:\\Users\\99126\\Desktop\\mp3");

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, MessageProto.WavMessage msg) throws Exception {
        byteStringNodeHelper.addByteStringNode(msg.getWavUuid(), msg.getTotal(), new ByteStringNode(msg.getCurrent(), msg.getData()));
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {

    }

}
